#!/usr/bin/python

# mainwindow.py

import sys
from PyQt4 import QtGui, QtCore

class MainWindow(QtGui.QMainWindow):
	def __init__(self):
		QtGui.QMainWindow.__init__(self)

		self.resize(300,400)
		self.setWindowTitle('mainwindow')
		
		textEdit = QtGui.QTextEdit()
		x = "QtGui.QMouseEvent.globalX()"
		textEdit.append(x)
		self.setCentralWidget(textEdit)

		exit = QtGui.QAction(QtGui.QIcon('i.png'),'Exit', self)
		exit.setShortcut('Ctrl+Q')
		exit.setStatusTip('Exit application')
		self.connect(exit, QtCore.SIGNAL('triggered()'),QtCore.SLOT('close()'))
		
		self.statusBar()
		
		menubar = self.menuBar()
		file = menubar.addMenu('&File')
		file.addAction(exit)
		
		toolbar = self.addToolBar('Exit')
		toolbar.addAction(exit)

app = QtGui.QApplication(sys.argv)
main = MainWindow()
main.show()
sys.exit(app.exec_())
	